﻿#region Using Statements

#endregion

namespace DirectZZT.Shared.World.Objects
{
    /// <summary>
    /// Defines a means for <see cref="BoardObject"/>s that represent projectiles.
    /// </summary>
    public interface IProjectileBoardObject
    {
        /// <summary>
        /// Gets/sets the source object which spawned this projectile.
        /// </summary>
        BoardObject Source { get; set; }
        /// <summary>
        /// Gets/sets the current speed multiplier of this projectile.
        /// </summary>
        float Speed { get; set; }
        /// <summary>
        /// Gets/sets the range (in fields) of this projectile. Use 0 for infinite range until hitting something (border or an other object).
        /// </summary>
        int Range { get; set; }
        /// <summary>
        /// Gets/sets the direction in which the projectile travels until hitting something.
        /// </summary>
        Direction TravelDirection { get; set; }
    
        /// <summary>
        /// Determines whether or not the specified <see cref="BoardObject"/> can be hit this projectile item.
        /// Some objects (like a fake wall, another projectile or such) cannot be hit, but most can.
        /// </summary>
        /// <param name="obj">The <see cref="BoardObject"/> that is about being hit.</param>
        /// <returns>Whether or not the specified <see cref="BoardObject"/> can be hit by this projectile.</returns>
        bool CanHit(BoardObject obj);
        /// <summary>
        /// Called when the specified <see cref="BoardObject"/> gets hit by this projectile.
        /// </summary>
        /// <param name="obj">The <see cref="BoardObject"/> that gets hit by this projectile.</param>
        /// <returns>Whether or not to disappear the bullet.</returns>
        bool OnHit(BoardObject obj);
    }
}
